package com.example.inami;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.example.inami.third.controller.NbIotYunDeviceInfoController;
import com.example.inami.third.entity.CfsDataNbTemp;
import com.example.inami.third.entity.CfsDataNbUsermonitorinfo;
import com.example.inami.third.entity.NbIotYunDeviceInfo;
import com.example.inami.third.entity.PageParam;
import com.example.inami.third.service.CfsDataNbTempService;
import com.example.inami.third.service.CfsDataNbUsermonitorinfoService;
import com.example.inami.third.service.NbIotYunDeviceInfoService;
import com.example.inami.third.service.NbIotYunSyncInfoService;
import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Date;
import java.util.List;
import java.util.Random;

@SpringBootTest
class InamiApplicationTests1 {

    @Autowired
    private NbIotYunDeviceInfoController nbIotYunDeviceInfoController;
    @Autowired
    private NbIotYunDeviceInfoService nbIotYunDeviceInfoService;
    @Autowired
    private NbIotYunSyncInfoService nbIotYunSyncInfoService;
    @Autowired
    private CfsDataNbUsermonitorinfoService cfsDataNbUsermonitorinfoService;
    @Autowired
    private CfsDataNbTempService cfsDataNbTempService;

    @Test
    void contextLoads() throws InterruptedException {
    }


    @Test
    void up(){
        List<CfsDataNbUsermonitorinfo> list = cfsDataNbUsermonitorinfoService.list();
        long code = 110114010000000L;
        for (CfsDataNbUsermonitorinfo temp : list) {
            code++;
            temp.setMonitorCode(String.valueOf(code));
            temp.setImei(String.valueOf(code));
            UpdateWrapper<CfsDataNbUsermonitorinfo> updateWrapper = new UpdateWrapper<>();
            updateWrapper.eq("id", temp.getId());

            cfsDataNbUsermonitorinfoService.update(temp,updateWrapper);
        }

    }


}
